package com.xinqi.modules.prepare.discuss.manager;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinqi.common.mybatis.data.service.BaseService;
import com.xinqi.modules.prepare.discuss.domain.PrepareDiscussEntity;
import com.xinqi.modules.prepare.discuss.dto.req.PrepareDiscussQueryDTO;
import com.xinqi.modules.prepare.discuss.dto.rsp.PrepareDiscussResultDTO;
import com.xinqi.modules.prepare.folder.domain.PrepareFileFolderEntity;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 备课区讨论管理层
 *
 * @author: system
 * @date: 2023/03/19
 */
public interface PrepareDiscussManager extends BaseService<PrepareDiscussEntity> {

    /**
     * 自定义分页查询
     */
    Page<PrepareDiscussResultDTO> findPage(Page<Object> page, PrepareDiscussQueryDTO query);

    /**
     * 自定义列表查询
     */
    List<PrepareDiscussResultDTO> findList(PrepareDiscussQueryDTO query);

    /**
     * 根据id查询 备课区讨论数据
     */
    PrepareDiscussEntity findById(Long id);

    /**
     * 根据id删除 备课区讨论数据
     */
    @Transactional(rollbackFor = Exception.class)
    boolean deleteById(Long id);

    @Transactional(rollbackFor = Exception.class)
    void copy(Long refId, PrepareFileFolderEntity target);

    @Transactional(rollbackFor = Exception.class)
    void move(PrepareFileFolderEntity file);

    @Transactional(rollbackFor = Exception.class)
    Boolean restore(Long id);

    boolean deleteById(PrepareDiscussEntity entity);
}
